import 'job_list.dart';

class PersonBaseModel {
  String? id;
  String? leaderId;
  String? name;
  String? leaderName;
  String? sex;
  String? nation;
  String? region;
  String? regionProvinceId;
  String? regionCityId;
  String? image;
  String? hometown;
  String? hometownProvinceId;
  String? hometownCityId;
  String? hometownCountyId;
  String? birthday;
  String? education;
  String? degree;
  String? member;
  String? currentPosition;
  String? baikeInCharge;
  String? inCharge;
  String? baikeUrl;
  String? sort;
  int? isValid;
  String? createBy;
  String? createTime;
  String? updateBy;
  dynamic updateTime;
  int? age;
  String? birthdayStr;
  dynamic hometownProvinceName;
  dynamic hometownCityName;
  String? regionProvinceName;
  String? regionCityName;
  List<dynamic>? schoolList;
  List<JobList>? jobList;

  PersonBaseModel({
    this.id,
    this.leaderId,
    this.name,
    this.leaderName,
    this.sex,
    this.nation,
    this.region,
    this.regionProvinceId,
    this.regionCityId,
    this.image,
    this.hometown,
    this.hometownProvinceId,
    this.hometownCityId,
    this.hometownCountyId,
    this.birthday,
    this.education,
    this.degree,
    this.member,
    this.currentPosition,
    this.baikeInCharge,
    this.inCharge,
    this.baikeUrl,
    this.sort,
    this.isValid,
    this.createBy,
    this.createTime,
    this.updateBy,
    this.updateTime,
    this.age,
    this.birthdayStr,
    this.hometownProvinceName,
    this.hometownCityName,
    this.regionProvinceName,
    this.regionCityName,
    this.schoolList,
    this.jobList,
  });

  factory PersonBaseModel.fromJson(Map<String, dynamic> json) =>
      PersonBaseModel(
        id: json['id'] as String?,
        leaderId: json['leaderId'].toString(),
        name: json['name'] as String?,
        leaderName: json['leaderName'].toString(),
        sex: json['sex'] as String?,
        nation: json['nation'] as String?,
        region: json['region'] as String?,
        regionProvinceId: json['regionProvinceId'] as String?,
        regionCityId: json['regionCityId'] as String?,
        image: json['image'] as String?,
        hometown: json['hometown'] as String?,
        hometownProvinceId: json['hometownProvinceId'] as String?,
        hometownCityId: json['hometownCityId'] as String?,
        hometownCountyId: json['hometownCountyId'] as String?,
        birthday: json['birthday'] as String?,
        education: json['education'] as String?,
        degree: json['degree'] as String?,
        member: json['member'] as String?,
        currentPosition: json['currentPosition'] as String?,
        baikeInCharge: json['baikeInCharge'] as String?,
        inCharge: json['inCharge'] as String?,
        baikeUrl: json['baikeUrl'] as String?,
        sort: json['sort'] as String?,
        isValid: json['isValid'] as int?,
        createBy: json['createBy'] as String?,
        createTime: json['createTime'] as String?,
        updateBy: json['updateBy'] as String?,
        updateTime: json['updateTime'] as dynamic,
        age: json['age'] as int?,
        birthdayStr: json['birthdayStr'] as String?,
        hometownProvinceName: json['hometownProvinceName'] as dynamic,
        hometownCityName: json['hometownCityName'] as dynamic,
        regionProvinceName: json['regionProvinceName'] as String?,
        regionCityName: json['regionCityName'] as String?,
        schoolList: json['schoolList'] as List<dynamic>?,
        jobList: (json['jobList'] as List<dynamic>?)
            ?.map((e) => JobList.fromJson(e as Map<String, dynamic>))
            .toList(),
      );

  Map<String, dynamic> toJson() => {
        'id': id,
        'leaderId': leaderId,
        'name': name,
        'leaderName': leaderName,
        'sex': sex,
        'nation': nation,
        'region': region,
        'regionProvinceId': regionProvinceId,
        'regionCityId': regionCityId,
        'image': image,
        'hometown': hometown,
        'hometownProvinceId': hometownProvinceId,
        'hometownCityId': hometownCityId,
        'hometownCountyId': hometownCountyId,
        'birthday': birthday,
        'education': education,
        'degree': degree,
        'member': member,
        'currentPosition': currentPosition,
        'baikeInCharge': baikeInCharge,
        'inCharge': inCharge,
        'baikeUrl': baikeUrl,
        'sort': sort,
        'isValid': isValid,
        'createBy': createBy,
        'createTime': createTime,
        'updateBy': updateBy,
        'updateTime': updateTime,
        'age': age,
        'birthdayStr': birthdayStr,
        'hometownProvinceName': hometownProvinceName,
        'hometownCityName': hometownCityName,
        'regionProvinceName': regionProvinceName,
        'regionCityName': regionCityName,
        'schoolList': schoolList,
        'jobList': jobList?.map((e) => e.toJson()).toList(),
      };
}
